package model

import "gorm.io/gorm"

type Comment struct {
	gorm.Model
	UserId  int    `gorm:"type:int" json:"userId"`
	PostId  int    `gorm:"type:int" json:"postId"`
	Content string `gorm:"type:varchar(100)" json:"content"`
}

func (c *Comment) AddComment(db *gorm.DB) error {
	return db.Create(&c).Error
}
